import { RouteRecordRaw } from "vue-router";
import HomePage from "@/views/HomePage.vue";
import InterfaceInfoDetailPage from "@/views/InterfaceInfoDetailPage.vue";
import UserLayout from "@/layouts/UserLayout.vue";
import UserLoginPage from "@/views/user/UserLoginPage.vue";
import UserRegisterPage from "@/views/user/UserRegisterPage.vue";
import UserCenter from "@/views/user/UserCenter.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "接口广场",
    component: HomePage,
  },
  {
    path: "/interfaceInfo/detail/:id",
    name: "接口信息",
    component: InterfaceInfoDetailPage,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/user",
    name: "用户",
    component: UserLayout,
    children: [
      {
        path: "/user/login",
        name: "用户登录",
        component: UserLoginPage,
      },
      {
        path: "/user/register",
        name: "用户注册",
        component: UserRegisterPage,
      },
      {
        path: "/user/center",
        name: "个人中心",
        component: UserCenter,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },
];
